<?php
require_once 'Abstracts.php';

class NoticeModel extends Abstracts{

    public function noticeCount($where){
       $sql = " SELECT count(u.id) AS c FROM pk_notice AS u ".$where;
       $query = $this->query($sql);
       $data = $query->row_array();
       return $data['c']?$data['c']:0;
       
    }
    
    public function updateState($sql){
        return $this->query($sql);
    }
    
    
    public function friendCount($where){
       $sql = " SELECT count(id) AS c FROM pk_user_friend ".$where;
       $query = $this->query($sql);
       $data = $query->row_array();
       return $data['c']?$data['c']:0;
    }
    
}